/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package td1;

import java.awt.BorderLayout;
import java.awt.Color;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Image;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 * Fenetre principale de l'application 
 * @author saluzzo
 */
public class IHM extends JFrame {

    public IHM(Controleur pControleur) {
        try {
           UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
           SwingUtilities.updateComponentTreeUI(this);
           //force chaque composant de la fenêtre à appeler sa méthode updateUI
        }
        catch (InstantiationException e) {}
        catch (ClassNotFoundException e) {}
        catch (UnsupportedLookAndFeelException e) {}
        catch (IllegalAccessException e) {}

        this.setIconImage(new ImageIcon("icon.png").getImage());
        this.setTitle("VectoriX");
        Controleur = pControleur;
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setLayout(new BorderLayout());

        ZoneDessin = new JPanel(new GridLayout(1, 1));
        this.getContentPane().add(ZoneDessin, BorderLayout.CENTER);
        this.jc = new JavaCanvas(this);
        ZoneDessin.add(this.jc);

        this.BarreMenu = new BarreDesMenus(this);
        this.getContentPane().add(this.BarreMenu, BorderLayout.NORTH);

        this.ModeleListeCollection = new DefaultListModel();
        this.ListeCollection = new JList(ModeleListeCollection);
        this.getContentPane().add(this.ListeCollection, BorderLayout.WEST);
        this.ListeCollection.setPreferredSize(new Dimension(270, 0));
        this.ListeCollection.setBorder(BorderFactory.createLineBorder(Color.BLACK));
        this.ListeCollection.setBackground(this.BarreMenu.getBackground());
        this.pack();
        
    }

    public Controleur getControleur() {
        return Controleur;
    }
    public DefaultListModel getModeleListeCollection() {
        return ModeleListeCollection;
    }
    
   
    private JPanel ZoneDessin;
    public JavaCanvas jc;
    private Controleur Controleur;
    private JList ListeCollection;
    private DefaultListModel ModeleListeCollection;
    private BarreDesMenus BarreMenu;

    public static void main(String[] args) {
    }

    









}
